package com.zj.system.controller;

import com.seventh.common.pojo.R;
import com.zj.system.aop.LogAnnotation;
import com.zj.system.pojo.vo.LoginVo;
import com.zj.system.service.LoginSer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiParam;
import org.apache.shiro.crypto.hash.Md5Hash;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @program: clms-seventh
 * @description: 登陆的控制层
 * @author: 张静
 * @create: 2021-07-16 20:52
 **/
@RestController

@RequestMapping("system")
@ApiModel(value = "用户登录控制层",description = "用户登录控制层")
public class LoginController {
    @Autowired
    private LoginSer loginSer;
    @PostMapping("login")
    @ApiModelProperty("查询账号密码是否正确")
    @LogAnnotation(title ="登陆接口", action ="登陆验证",businessType = "0")
    public R login(@ApiParam("登陆的账号密码")@RequestBody LoginVo vo){

        return loginSer.login(vo);
    }
    @GetMapping("parse")
    @ApiModelProperty("解析token信息")
    @LogAnnotation(title ="登陆接口", action ="解析token令牌",businessType = "0")
    public R solvtoken(@ApiParam("令牌token信息")String token){
        return loginSer.solvtoken(token);
    }
    public static void main(String[] args) {
        Md5Hash md5Hash=new Md5Hash("123456","seventh",1024);
        System.out.println(md5Hash);
    }
}
